home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Text⁄Files / Suntar 1.3.2 / suntar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-31  |  20.3 KB  |  676 lines  |  [TEXT/KAHL]

  1. /*******************************************************************************\
  2.  
  3. include file
  4.  
  5. suntar 1.3, ©1991-92 Sauro & Gabriele Speranza
  6.  
  7. This program is public domain, feel free to use it or part of it for anything
  8.  
  9. \*******************************************************************************/
  10. #include <setjmp.h>
  11.  
  12. #define V_13
  13.  
  14. #define hqxID    145
  15. #define writeID 132
  16. #define hackID    133
  17. #define tarPopupID 146
  18. #define ntAPopupID 147
  19.  
  20. #define fmGetInfo    1
  21. #define fmOpen        2
  22. #define fmClose        3
  23. #define fmEject        3
  24. #define fmCopy        5
  25. #define fmList        6
  26. #define fmExtract     7
  27. #define fmSelect    8
  28. #define fmAppend    10
  29. #define fmWriteTar    11
  30. #define fmWriteBar    12
  31. #define fmFormat    14
  32. #define fmPause        16
  33. #define fmAbort        17
  34. #define fmQuit        18
  35. #define last_fm_command fmFormat
  36.  
  37. #define pmOptions    6
  38. #define pmEnglish    10
  39. #define pmConfirm    11
  40. #define pmExpert    8
  41. #define pmIgnore    12
  42. #define pmNoConvers 13
  43.  
  44. #define wmDataFork 1
  45. #define wmASCII 2
  46. #define wmWriteMacBin 3
  47. #define wmWriteTar 4
  48. #define wmSetLabel 6
  49. #define wmEndWrite 8
  50.  
  51. #define hmView 1
  52. #define hmClear 2
  53. #define hmSave 3
  54. #define hmOverwrite 4
  55. #define hmMac_ize 5
  56. #define hmDriveList 6
  57. #define hmFind 7
  58. #define hmUntar 8
  59. #define hmUnbar 9
  60. #define hmList 10
  61. #define hmAgain 11
  62.  
  63. #define bmDisable 1
  64. #define bmShowExtr 3
  65. #define bmSaveInfo 4
  66. #define bmShowList 6
  67.  
  68. #define ff_tarbar 1
  69. #define ff_ASCII 2
  70. #define ff_macbin 3
  71. #define ff_c_macbin 4
  72. #define ff_binhex 5
  73. #define ff_packit 6
  74.  
  75. #define SHOWINFO (all_listonly&&(disable_binhex&4) || (!all_listonly&&(disable_binhex&2) ))
  76. #define SAVEINFO (!listonly&&(disable_binhex&9)==8)
  77.  
  78. /* this define is used to compare the return value of a menu selection 
  79. with known menu items */
  80. #define menuItemMess(ID,item) (((long)ID<<16)+item)
  81.  
  82. #define signature 'S691';    /* useless, since OpenWD usually ignores it... */
  83.  
  84. #ifndef LF
  85. #define LF     '\012'    /*    '\n' in Think C, '\r' in MPW    */
  86. #define CR     '\015'    /*    '\r' in Think C, '\n' in MPW     */
  87. #endif
  88.  
  89. #define highbyte(x)        (((unsigned char *) &(x))[0])
  90. #define lowbyte(x)        (((unsigned char *) &(x))[1])
  91.  
  92. #define max_drive 4
  93.  
  94. typedef long sector_t;
  95. #define SECTOR_T_SIZE 4
  96.  
  97. #ifdef THINK_C_5
  98. /* Damn it ! Think C 5 has changed the rules for assigning offsets to
  99. struct fields (thanks to Basil Duval for reporting the problem to us).
  100. Really that's not a bug, the assignment of offsets to struct fields is
  101. an implementation choice which the compiler may arbitrarily alter, but
  102. that's absolutely bad when the struct describes something which exists
  103. outside the program (in this case, also in a different machine than the
  104. current one, with different operating system etc.), so that the internal
  105. structure of the struct cannot be arbitrarily altered.
  106.   The solution is to alter the declarations in such a way that
  107. ThC5 assigns the correct offsets (hoping that the rules won't be
  108. changed again !). It would be more portable not to use a struct at all,
  109. but a set of #define's which take pointers to an array of char, add an
  110. offset and cast to the proper type, but that would require many
  111. changes and would greatly decrease the readability of the source code...
  112.  Think of what would happen if the structs used by the ToolBox could
  113. not be represented by struct declarations: you would become crazy
  114. adjusting your programs...
  115. */
  116.  
  117.  
  118. typedef struct tarh_type{
  119.     char name[100];
  120.     char mode[8];
  121.     char uid[8];
  122.     char gid[8];
  123.     char size[12];
  124.     char mtime[12];
  125.     char chksum[8];
  126.     char linkflag;
  127.     char linkname[100-1];    /* if the size is not odd, THC5 places a padding byte before
  128.                             it so it's aligned to an even address => catastrophe ! */
  129.     char lastbyte1;            /* but obviously the last byte must be present ! */
  130.     char magic[8-1];
  131.     char lastbyte2;
  132.     char uname[32-1];
  133.     char lastbyte3;
  134.     char gname[32-1];
  135.     char lastbyte4;
  136.     char devmajor[8-1];
  137.     char lastbyte5;
  138.     char devminor[8-1];
  139.     char lastbyte6;
  140.     char atime[12-1];
  141.     char lastbyte7;
  142.     char ctime[12-1];
  143.     char lastbyte8;
  144.     char offset[12-1];
  145.     char lastbyte9;
  146.     char longnames[4-1];
  147.     char lastbyte10;
  148.     char fill[127];
  149. } tarh_type;
  150. extern tarh_type tarh;
  151.  
  152. typedef struct barh_type{
  153.     char mode[8];
  154.     char uid[8];
  155.     char gid[8];
  156.     char size[12];
  157.     char mtime[12];
  158.     char chksum[8];
  159.     char rdev[8];
  160.     char linkflag;
  161.     char bar_magic[2-1];
  162.     char lastbyte11;
  163.     char volume_num[4-1];
  164.     char lastbyte12;
  165.     char compressed;
  166.     char cdate[12];
  167.     char name[100];
  168.     char linkname[100];
  169.     char uname[32];
  170.     char gname[32];
  171.     char devmajor[8];
  172.     char devminor[8];
  173.     char fill[148];
  174. } barh_type;
  175.  
  176. extern struct binh_type{
  177.     /*byte version;*/
  178.     unsigned char nlen;
  179.     char name[63];
  180.     FInfo finfo;
  181.     char protected;
  182.     char zero;
  183.     long dflen;
  184.     long rflen;
  185.     long cdate;
  186.     long mdate;
  187.     short gilen;
  188.     char extra_fflags;
  189.     char unused[14-1];
  190.     char lastbyte13;
  191.     char packlen[4-1];
  192.     char lastbyte14;
  193.     char headlen[2-1];
  194.     char lastbyte15;
  195.     unsigned char uploadvers;
  196.     unsigned char readvers;
  197.     char crc[2-1];
  198.     char lastbyte16;
  199.     char padding[2-1];
  200.     char lastbyte17;
  201. } macbinh;
  202.  
  203.  
  204.  
  205. #else
  206. /* no problem, use the original declarations */
  207.  
  208. typedef struct tarh_type{
  209.     char name[100];
  210.     char mode[8];
  211.     char uid[8];
  212.     char gid[8];
  213.     char size[12];
  214.     char mtime[12];
  215.     char chksum[8];
  216.     char linkflag;
  217.     char linkname[100];
  218.     char magic[8];
  219.     char uname[32];
  220.     char gname[32];
  221.     char devmajor[8];
  222.     char devminor[8];
  223.         /* these following fields were added by JF for gnu */
  224.         /* and are NOT standard */
  225.         char    atime[12];
  226.         char    ctime[12];
  227.         char    offset[12];
  228.         char    longnames[4];
  229.     char fill[127];
  230. } tarh_type;
  231. extern tarh_type tarh;
  232.  
  233. typedef struct barh_type{    /* dalla documentazione UNIX 
  234.                             -- from the bar(5) page of man */
  235.     char mode[8];
  236.     char uid[8];        /* in ottale nell'header di file, in decimale in quello di volume 
  237.                         --in octal in file headers, decimal in volume headers */
  238.     char gid[8];        /* idem */
  239.     char size[12];        /* in ottale; nel volume header, è il numero di bytes restanti del 
  240.                         file a metà tra due dischetti (sempre multiplo di 512)
  241.                         -- in octal; in the volume header, it's the number of bytes 
  242.                         remaining from a previous file (always multiple of 512) */
  243.     char mtime[12];        /* in ottale, secondi dal 1 gen 1970 
  244.                         -- in octal, seconds since 1 jan 1970 */
  245.     char chksum[8];        /* in ottale */
  246.     char rdev[8];        /* ??? */
  247.     char linkflag;
  248.     char bar_magic[2];    /* 'V\0', solo nell'header di volume 
  249.                         -- 'V\0', only in the volume header */
  250.     char volume_num[4];    /* decimale... */
  251.     char compressed;    /* '0', solo nel volume header 
  252.                         -- '0', only in the volume header */
  253.     char cdate[12];        /* nel volume header, dice quando si e' creato l'archivio: YYMMDDHHmm\0 
  254.                         -- in the volume header, archive creation date: YYMMDDHHmm\0 */
  255.     char name[100];
  256.     char linkname[100];    /* in file normali tutto 0, come i seguenti...
  257.                         però, non è così: il nome del link parte immediatamente
  258.                         dopo il \0 che chiude il nome, non ad un offset fisso 
  259.                         -- see comments in the untar.c file */
  260.     char uname[32];
  261.     char gname[32];
  262.     char devmajor[8];
  263.     char devminor[8];
  264.     char fill[148];
  265. } barh_type;
  266.  
  267. extern struct binh_type{
  268.     /*byte version;*/         /* the first byte is present in the MacBinary file but is
  269.                             NOT copied to this struct, so that the most commonly used
  270.                             fields start at an even address */
  271.     unsigned char nlen;        /* Length of filename. */
  272.     char name[63];            /* Filename (only 1st nlen are significant) */
  273.     FInfo finfo;            /* type, creator, flags, zero1 (flags 0-7 must be cleared),
  274.                             point in folder, enclosing folder */
  275.     char protected;            /* = 1 for protected file, 0 otherwise */
  276.     char zero;                /* must be 0 */
  277.     long dflen;                /* Data Fork length (bytes) */
  278.     long rflen;                /* Resource Fork length */
  279.     long cdate;                /* File's creation date */
  280.     long mdate;                /* File's "last modified" date */
  281.     short gilen;            /* GetInfo message length (MacBinary II only) */
  282.     char extra_fflags;        /* Finder flags, bits 0-7 (MacBinary II only) */
  283.     char unused[14];
  284.     char packlen[4];        /* length of total files when unpacked */
  285.     char headlen[2];        /* length of secondary header (MacBinary II only) */
  286.     unsigned char uploadvers;        /* Version of MacBinary II that the uploading program is written for */
  287.     unsigned char readvers;            /* Minimum MacBinary II version needed to read this file */
  288.     char crc[2];            /* CRC of the previous 124 bytes */
  289.     char padding[2];        /* two trailing unused bytes */
  290. } macbinh;
  291.  
  292. #endif
  293.  
  294. extern short err_code;        /* error code from read_sectors and write_sectors */
  295. extern short drive_number;
  296.  
  297. extern Boolean non_convertire;    /* disable conversions */
  298. extern OSType text_creator;
  299. extern Boolean ignore_errors,in_Italia,expert_mode,confirm_saves,bar_archive,multiVolume;
  300. extern unsigned char listonly;
  301. extern unsigned short max_hqx_header;
  302. extern unsigned char previousFormat;
  303. extern short info_file_open;
  304. extern short info_file;
  305. extern short current_crc,disable_binhex;
  306. extern short show_info;
  307. extern Boolean save_info;
  308.  
  309. extern short list_buf_size;
  310. extern long hqx_length;
  311. extern sector_t sect_n,sectors_on_floppy;
  312.  
  313. extern SFReply reply;
  314. extern Point where[];
  315. extern MenuHandle myMenus[4],hqxM;
  316. extern jmp_buf main_loop;
  317. extern unsigned char disk_buffer[512];
  318. extern char ultimo_header[184];    /* non tutto, solo la parte che tiene i campi 
  319.         importanti: lo uso sia in lettura sia in scrittura
  320.         -- see in untar.c and tar.c */
  321. extern Boolean ultimo_disco_espulso,ultimo_header_valido;
  322. extern sector_t avail_sectors_for_file;
  323. extern long last_offset;
  324. extern Boolean gHasResolveAlias;
  325. extern Boolean hasVheader;
  326. extern short inputFile;
  327. extern Boolean inf_is_open;
  328. extern short inf_refn;
  329. extern unsigned char file_aperto;
  330. extern short floppy_n;
  331. extern sector_t settori_passati;
  332. extern short curr_vrefnum;
  333.  
  334.  
  335. enum tipo_fase {
  336. /* the "fase" (phase) variable always remembers what suntar is currently doing, so that
  337. some decisions may be performed by any function, not only by the higher levels of 
  338. the functions hierarchy */
  339. non_faccio_nulla,        /* nessun comando in corso di esecuzione, in attesa di uno 
  340.                         -- no command is being executed, waiting for one */
  341. ricevuto_comando,        /* ho ricevuto un comando ma sono ancora nei preliminari 
  342.                         (aspetta_inserzione...) e posso ancora uscirne premendo un
  343.                         bottone di annulla 
  344.                         -- received a command, but I am in the preliminary phase
  345.                         of its execution (disk insertion dialog box...) hence the
  346.                         command may still be cancelled by clicking on a button */
  347. paused,                    /* tra Pause e Resume... */
  348. in_writing,                /* sono nel menù di writing, pronto a ricevere comandi 
  349.                         -- ready to accept commands from the Write menu */
  350. reading_sect_n,            /* sto leggendo un numero di settore dalla console
  351.                         -- in expert mode, reading from the console */
  352. initializing,            /* sto eseguendo il comando di inizializzare un disco: a
  353.                         differenza dagli altri casi, la fase diventa questa prima 
  354.                         di chiamare aspetta_inserzione
  355.                         -- initializing a disk: in this case, the phase includes 
  356.                         the preliminaries which otherwise are ricevuto_comando
  357.                         */
  358. writing_disk,            /* sto realmente scrivendo su floppy disk, ma potrei
  359.                         anche essere in pausa per attesa disco successivo o per il
  360.                         comando "Pause": se sono chiamato da MainEvent posso usare la
  361.                         variabile sto_lavorando per sapere se non sono né in pausa
  362.                         né in semimodal e finestra_sm_aperta per sapere se sono
  363.                         in semimodal: assolutamente non assegnare quelle variabili!
  364.                         -- writing to a floppy disk, or maybe paused or waiting for 
  365.                         another disk: the two variables sto_lavorando (I'm working) and 
  366.                         finestra_sm_aperta (semimodal window is open) may be consulted to
  367.                         distinguish the three cases
  368.                         */
  369. reading_disk,            /* sto realmente leggendo da floppy disk, ma come sopra 
  370.                         -- as above... */
  371. hack_listing,            /* sto eseguendo un expert list
  372.                         -- executing the expert list command
  373.                         */
  374. hack_reading,            /* sto eseguendo un untar at sector o unbar at sector
  375.                         -- executing untar at sector or unbar at sector
  376.                         */
  377. selected_reading        /* sto leggendo col comando Extract selected files
  378.                         -- reading by "Extract selected files" */
  379. };
  380. extern enum tipo_fase fase;
  381.  
  382. enum os_type {unknown_os,mac_MFS,mac_HFS,msdos};
  383. extern struct disk_info{
  384.     Boolean is_not_initialized;
  385.     enum os_type os;
  386.     short disk_code;        /* as the return value of PBMountVol, but often it's
  387.                             computed by suntar itself */
  388.     /* the following fields are useful only if the disk must be initialized */
  389.     sector_t max_format;
  390.     short format_index,
  391.         supports_720K;
  392.     } di;
  393.  
  394. enum formats{unreadable_disk,tar_format,bar_format,unknown_format};
  395.  
  396. typedef struct {
  397.     OSType tx_cr;
  398.     #define text_creator options.tx_cr
  399.     short d_back;    /* delay when going to background during a disk write */
  400.     #define delay_back options.d_back
  401.     unsigned short m_to_beep;
  402.     #define min_to_beep options.m_to_beep
  403. #ifdef V_122
  404.     unsigned char opt_bytes[12];
  405. #else
  406.     unsigned char opt_bytes[20];
  407. #endif
  408.     #define tar_version options.opt_bytes[0]            /* popup */
  409.  
  410. #define tar_unknown 0
  411. #define tar_singlevol 1
  412. #define tar_GNU 2
  413. #define tar_AIX 3
  414.  
  415.     #define accetta_GCR options.opt_bytes[1]
  416.     #define resolve_aliases options.opt_bytes[2]
  417.     #define crea_mac_dir options.opt_bytes[3]
  418.     #define non_text_ASCII options.opt_bytes[4]        /* was radio buttons, now is popup */
  419.     #define save_modi_date options.opt_bytes[5]
  420.     #define useSys7_SF options.opt_bytes[6]
  421.     #define del_incompl options.opt_bytes[7]
  422.     #define trunc_14 options.opt_bytes[8]
  423.     #define pres_underscore !options.opt_bytes[9]
  424.     #define suppress_shell_chars !options.opt_bytes[10]
  425.     #define verify_writes options.opt_bytes[11]
  426.     #define smallFilesAreASCII options.opt_bytes[12]
  427.  
  428. #define first_check_option 1
  429. #define last_check_option  12
  430. #define skip_check_option   4
  431.  
  432.     #ifdef V_13        /* new field added in the 1.3; I preferred not to alter
  433.                     the layout of the previous fields in case somebody uses
  434.                     ResEdit to move his old OPTs resource to the new version
  435.                     */
  436.     OSType gif_cr;
  437.     #define gif_creator options.gif_cr
  438.     #endif
  439.     } options_type;
  440. extern options_type options;
  441.  
  442. #ifdef THINK_C_5
  443. #define OsErr OSErr
  444. #endif
  445.  
  446. /* prototypes for untar.c */
  447.  
  448. char *my_p2cstr(unsigned char*);
  449. unsigned char*my_c2pstr(char*);
  450. void mcopy(char *,char *,unsigned short);
  451. void init_hd_buffering(void);
  452. short readblock(char*,short);
  453. void unget_block(void);
  454. void unget_char(void);
  455. void end_of_file(void);
  456. void skip_file(long);
  457. void stampa_buffer(sector_t,unsigned char *);
  458. short isASCII(long,short*);
  459. Boolean print_if_string(char*,char*,short);
  460. void my_untar(void);
  461. void my_unbar(void);
  462. short unbar_checksum(unsigned char *,short,long *);
  463. unsigned char guess_bar_linkflag(void);
  464. void unbar(void);
  465. void copia_ultimo_header(char*,sector_t);
  466. void bar_check_floppy_swap(short);
  467. short inserzione_assicurata(char*,Boolean);
  468. short bar_check_settore0(sector_t*,Boolean);
  469. void tar_check_floppy_swap(short);
  470. short tar_check_settore0(Boolean);
  471. void close_or_del_out_file(void);
  472. void check_confirmation(void);
  473. void check_conf_dir(char*);
  474. void my_itoa(long,char *);
  475. void clear_unused_fields(void);
  476. void print_type_creator(OSType,OSType);
  477. void print_one_date(long,char*);
  478. #ifdef V_122
  479.     void controlla_spazio(long,long);
  480.     void conferma_invisibili(void);
  481. #else
  482.     short controlla_spazio(long,long);
  483.     short crea_e_controlla(Boolean);
  484. #endif
  485. void get_openfile_location(short);
  486. void untar_hqx (long);
  487. void write_hqx_fork(short,long);
  488. void write_pit_fork(short,long);
  489. void set_binhex(void);
  490. short untar_checksum(unsigned char*,short,Boolean);
  491. short chkmacbin (long ,short);
  492. void setdata (void);
  493. void untar (void);
  494. void untar_file (long);
  495. void untar_data (long);
  496. void untar_macbin (long);
  497. void writefork(short,long,Boolean);
  498. void setmacbin (void);
  499. void untar_directory (void);
  500. void create_directory (char *);
  501. short create_file (char *,short,Boolean);
  502. void untar_link (void);
  503. void unix_to_mac (char *);
  504. long untar_number (char*,short);
  505. void pbsyserr (IOParam *);
  506.  
  507. /* prototypes for suntar.c */
  508. enum aa_mode {aa_load,aa_open,aa_getinfo};
  509. void apri_archivio(enum aa_mode,short);
  510. void chiudi_archivio(void);
  511. void copia_da_disco_a_file(void);
  512. void estrai_da_floppy(void);
  513. void scrivi_su_floppy(void);
  514. void disk_initialize(void);
  515. enum formats identify_format(void);
  516. short apri_file(char *,short *);
  517. OSErr new_text_file(short*);
  518. OSErr create_overwrite(OSType,OSType,short *);
  519. short mac_fread(char*,short,short);
  520. short mac_fwrite(char*,short,short);
  521. OSErr open_overwrite (char *,short,short *);
  522. Boolean my_disk_is_in(void);
  523. void handle_pause(void);
  524. void check_events(void);
  525. short check_error_and_events(void);
  526. void accept_abort_command(void);
  527. Boolean is_abort_command(void);
  528. Boolean is_pause_command(void);
  529. short aspetta_inserzione(char*,Boolean);
  530. void esamina_disco(void);
  531. void list_conciso(void);
  532. void check_foreground(void);
  533. void beep_in_foreground(void);
  534. void about_box(void);
  535. Boolean check_all_zero(char *);
  536. void print_info(char *,long);
  537. void raise_error(void);
  538. void error_message(char *);
  539. void error_message_1(char *,int);
  540. short check_error(void);
  541. void disk_error_message(void);
  542. void write_error_message(void);
  543. void hacking(short);
  544. short read_sect_n(sector_t *);
  545. short my_atoi(char*,short*);
  546. short my_atol(char*,long*);
  547. short untar_dec_number(char*,short);
  548. void macize_ASCII(char*,short);
  549. void overwrite_sectors(void);
  550. void print_sector_n(sector_t);
  551. void stampa_info_bar(short);
  552. void DriveList(void);
  553. void fine_lavoro(void);
  554. void set_skip_all(short);
  555. void prefs_da_risorsa(void);
  556. void load_options(void);
  557. void save_options(void);
  558. void flush_all(void);
  559.  
  560. /* prototypes for diskdriver.c */
  561. void disk_format(Boolean);
  562. short testa_stato(short*,Boolean);
  563. Boolean is_wrprot(void);
  564. enum os_type riconosci_disco_mac(unsigned char*);
  565. void identifica_hardware(void);
  566. void init_buffering(void);
  567. void check_allocated(void*);
  568. void flush_buffers(void);
  569. void invalid_buffers(void);
  570. void invalid_after(sector_t);
  571.  
  572. Boolean dirty_buffers(void);
  573. void leggi_settore(sector_t,char*);
  574. void scrivi_settore(sector_t,char*);
  575. void diskEject(void);
  576. void read_sectors(sector_t,char*,short);
  577. void write_sectors(sector_t,char*,short);
  578. void read_one_sector(sector_t,char *,short);
  579.  
  580. /* prototypes for tar.c */
  581. void fillmem(char*,char,short);
  582. void reset_sector_count(void);
  583. short warning_400_800(void);
  584. void printf_protetto(void);
  585. short warning_first_write(short);
  586. void de_Mac_ize(char*);
  587. void write_tar_volume_header(void);
  588. void write_bar_volume_header(void);
  589. short bar_header(char *,long,barh_type *);
  590. void bar_checksum(char *);
  591. void writeblock(char*,short);
  592. unsigned char get_linkflag(long *,short);
  593. void cerca_fine(void);
  594. void svuota_buffer(void);
  595. void azzera_settore(void);
  596. void tronca_archivio(void);
  597. Boolean compare_mem(char*,char*,short);
  598. void print_ready(void);
  599. void check_and_eject(void);
  600. void check_wr_err(void);
  601. void my_tar(short);
  602. void close_input_files(void);
  603. void FillMacBin2Fields(void);
  604. void assegna_tar_version(void);
  605. void controlla_che_ci_stia(sector_t);
  606. void tar_file_or_folder (char *);
  607. void tardir (char *);
  608. void tarfile (char*);
  609. void tardata (char*,short);
  610. void tarmacbin(char*,short);
  611. void macbinheader(void);
  612. void tar_writefork (long,short);
  613. short tarheader (char *,long);
  614. void fill_checksum(tarh_type *);
  615. void mac_to_unix(char*,char*);
  616. void numstr (char *,long,short);
  617. void statf (char *);
  618. short getvrefnum (char *);
  619. void nametoolong (char *);
  620.  
  621. /* prototypes for dialogs.c */
  622. void options_box(void);
  623. void select_and_extract(void);
  624. void my_alert(void);
  625. short my_modal_dialog(short,char **i,short);
  626. short my_semimodal_dialog(short,char **i,short,Str255,Str255,Str255);
  627. void my_edt_dialog(short,unsigned char*,short,unsigned char*);
  628. void SetCheckBox(DialogPtr,short);
  629. short dialogo_tipo_file(void);
  630.  
  631. /* prototypes for dehqx.c */
  632. void close_info_file(void);
  633. short ci_strcmp(char*,char*);
  634. short is_hqx_name(void);
  635. void check_CRC(void);
  636. short hqx_header(void);
  637. void FindStart (void);
  638. void init_hqx_tab(void);
  639. void read_hqx(char *,short);
  640. short read_3_hqx(unsigned char *,short);
  641. unsigned char get_hqx_byte(Boolean *);
  642. void open_info_file(void);
  643. void flush_hqx_header(short);
  644. void hqx_end_of_file(void);
  645. void CalcCRC(char);
  646.  
  647. /* prototypes for unpit.c */
  648. void my_unpit(void);
  649. void get_pit_bytes(char*,short);
  650. void deall_tree(void);
  651.  
  652. /* prototypes for folderSTDfile.c */
  653. void my_SF_Put(unsigned char *,unsigned char *);
  654. void my_SF_Get(short,SFTypeList);
  655. short get_file_or_folder(Str255,short,SFTypeList*);
  656. void select_directory(void);
  657. Boolean get_file_with_checkbox(Boolean *);
  658. Boolean SFPut_con_pausa(unsigned char *,char*);
  659. void close_all_open_WD(void);
  660. void register_WD(short);
  661.  
  662. /* prototypes for StdFile.c & selectbutton.c */
  663. void pStrcat(unsigned char *,unsigned char *);
  664. void pStrcpy(unsigned char *,unsigned char *);
  665. OSErr PathNameFromDirID(long,short,char*);
  666. void doForceDirectory(WDPBRec*);
  667. void SetRadioButton(DialogPtr,short,short);
  668. void SelectButton(ControlHandle);
  669. void OutlineControl(ControlHandle);
  670.  
  671. /* prototypes for semimodal.c */
  672. short semimodalDialog(short,Point *,short (*)(EventRecord*),char **,short,
  673.     Str255,Str255,Str255,short,Boolean,void(*)(WindowRecord*));
  674. void close_semimodal(void);
  675.  
  676.